package pip.can;

import java.util.ArrayList;
import java.util.LinkedList;

public class Message {
	public int ContentId;
	public int ChunkId;
	public int noChunks;
	//public int source;
	private LinkedList<String> trace;
	public int size;
	public int trafficClass;
	public double requestTime;
	public Chunk Chunk;
	public Message(int ContId, int ChId, int tc, double req)
	{
		trace= new LinkedList<String>();
		ContentId=ContId;
		ChunkId=ChId;
		noChunks=0;
		size=0;
		Chunk=null;
		requestTime=req;
		trafficClass=tc;
	}
	public void addtrace(String node)
	{
//		System.out.println("dodaje do trace wezel "+node);
		trace.add(node);
	}
	public String getback()
	{
		if(!trace.isEmpty())
		{
			return trace.removeLast();
		}
		else
		{
			return null;
		}
	}
	public String lookBack()
	{
		if(!trace.isEmpty())
		{
			return trace.getLast();
		}
		else
		{
			return null;
		}
	}
}

